package vistop.datatypes;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class TestingClass {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println("================================");
		System.out.println("=============main===============");
		System.out.println("================================");
		
		List<Edge> result = getPolygonEdges(3);
		for(Edge e : result) {
			System.out.println(e.toString());
		}
	}
	
	public static List<Edge> getPolygonEdges(int i) {
		switch(i) {
			case 1: return fillEdges();
			case 2: return fillEdges2();
			case 3: return fillEdges3();
			case 4: return fillEdges4();
			case 5: return fillEdgesTess();
			default: return fillEdges();
		}
	}
	
	public static List<Edge> fillEdges() {
		List<Edge> edges = new ArrayList<Edge>();
		edges.add(new Edge(new Vertex(0, 0,0,0), new Vertex(0, 30,50,0)));
		edges.add(new Edge(new Vertex(0, 30,50,0), new Vertex(0, 20,30,0)));
		edges.add(new Edge(new Vertex(0, 20,30,0), new Vertex(0, 60,40,0)));
		edges.add(new Edge(new Vertex(0, 60,40,0), new Vertex(0, 80,-20,0)));
		edges.add(new Edge(new Vertex(0, 80,-20,0), new Vertex(0, 50,-30,0)));
		edges.add(new Edge(new Vertex(0, 50,-30,0), new Vertex(0, 0,0,0)));
		
		edges.add(new Edge(new Vertex(0, 10,10,0), new Vertex(0, 70,-10,0)));
		edges.add(new Edge(new Vertex(0, 70,-10,0), new Vertex(0, 40,20,0)));
		edges.add(new Edge(new Vertex(0, 40,20,0), new Vertex(0, 10,10,0)));
		return edges;
	}
	
	public static List<Edge> fillEdges2() {
		List<Edge> edges = new ArrayList<Edge>();
		edges.add(new Edge(new Vertex(0, 0,0,0), new Vertex(0, 10,50,0)));
		edges.add(new Edge(new Vertex(0, 30,10,0), new Vertex(0, 70,0,0)));
		edges.add(new Edge(new Vertex(0, 20,20,0), new Vertex(0, 110,40,0)));
		edges.add(new Edge(new Vertex(0, 90,-20,0), new Vertex(0, 80,50,0)));
		edges.add(new Edge(new Vertex(0, 100,-40,0), new Vertex(0, 60,-50,0)));
		edges.add(new Edge(new Vertex(0, 10,50,0), new Vertex(0, 20,20,0)));
		edges.add(new Edge(new Vertex(0, 30,-10,0), new Vertex(0, 0,0,0)));
		edges.add(new Edge(new Vertex(0, 70,0,0), new Vertex(0, 50,30,0)));
		edges.add(new Edge(new Vertex(0, 80,50f,0), new Vertex(0, 40,-30,0)));
		edges.add(new Edge(new Vertex(0, 60,-50,0), new Vertex(0, 30,-10,0)));
		edges.add(new Edge(new Vertex(0, 50,30,0), new Vertex(0, 30,10,0)));
		edges.add(new Edge(new Vertex(0, 40,-30,0), new Vertex(0, 90,-20,0)));
		edges.add(new Edge(new Vertex(0, 110,40,0), new Vertex(0, 100,-40,0)));
		return edges;
	}
	
	public static List<Edge> fillEdges3() {
		List<Edge> edges = new ArrayList<Edge>();
		edges.add(new Edge(new Vertex(0, 0, 2.25f, 0), new Vertex(0, 1, 0, 0)));
		edges.add(new Edge(new Vertex(0, 1, 0, 0), new Vertex(0, 1.625f, 1.25f, 0)));
		edges.add(new Edge(new Vertex(0, 1.625f, 1.25f, 0), new Vertex(0, 5.75f, 0.5f, 0)));
		edges.add(new Edge(new Vertex(0, 5.75f, 0.5f, 0), new Vertex(0, 5.5f, 3.75f, 0)));
		edges.add(new Edge(new Vertex(0, 5.5f, 3.75f, 0), new Vertex(0, 3.5f, 4.25f, 0)));
		edges.add(new Edge(new Vertex(0, 3.5f, 4.25f, 0), new Vertex(0, 2, 2.75f, 0)));
		edges.add(new Edge(new Vertex(0, 2, 2.75f, 0), new Vertex(0, 0, 2.25f, 0)));
		edges.add(new Edge(new Vertex(0, 2, 2, 0), new Vertex(0, 3.75f, 2.5f, 0)));
		edges.add(new Edge(new Vertex(0, 3.75f, 2.5f, 0), new Vertex(0, 2.875f, 1.5f, 0)));
		edges.add(new Edge(new Vertex(0, 2.875f, 1.5f, 0), new Vertex(0, 2, 2, 0)));
		edges.add(new Edge(new Vertex(0, 4.5f, 2.5f, 0), new Vertex(0, 3, 3.25f, 0)));
		edges.add(new Edge(new Vertex(0, 3, 3.25f, 0), new Vertex(0, 4.75f, 3.25f, 0)));
		edges.add(new Edge(new Vertex(0, 4.75f, 3.25f, 0), new Vertex(0, 4.5f, 2.5f, 0)));
		return edges;
	}
	
	public static List<Edge> fillEdges4() {
		List<Edge> edges = new ArrayList<Edge>();
		edges.add(new Edge(new Vertex(0, 0, 90, 0), new Vertex(0, 40, 0, 0)));
		edges.add(new Edge(new Vertex(0, 40, 0, 0), new Vertex(0, 65, 50, 0)));
		edges.add(new Edge(new Vertex(0, 65, 50, 0), new Vertex(0, 230, 20, 0)));
		edges.add(new Edge(new Vertex(0, 230, 20, 0), new Vertex(0, 220, 150, 0)));
		edges.add(new Edge(new Vertex(0, 220, 150, 0), new Vertex(0, 140, 170, 0)));
		edges.add(new Edge(new Vertex(0, 140, 170, 0), new Vertex(0, 80, 110, 0)));
		edges.add(new Edge(new Vertex(0, 80, 110, 0), new Vertex(0, 0, 90, 0)));
		edges.add(new Edge(new Vertex(0, 80, 80, 0), new Vertex(0, 150, 100, 0)));
		edges.add(new Edge(new Vertex(0, 150, 100, 0), new Vertex(0, 115, 60, 0)));
		edges.add(new Edge(new Vertex(0, 115, 60, 0), new Vertex(0, 80, 80, 0)));
		edges.add(new Edge(new Vertex(0, 180, 100, 0), new Vertex(0, 120, 130, 0)));
		edges.add(new Edge(new Vertex(0, 120, 130, 0), new Vertex(0, 190, 130, 0)));
		edges.add(new Edge(new Vertex(0, 190, 130, 0), new Vertex(0, 180, 100, 0)));
		return edges;
	}
	
	public static List<Edge> fillEdgesTess() {
		List<Edge> edges = new ArrayList<Edge>();
		Vertex a = new Vertex(0, 0, 0, 0, new double[] {1, 0, 0, 1});
		Vertex b = new Vertex(0, 0, 4, 0, new double[] {1, 1, 0, 1});
		Vertex c = new Vertex(0, 4, 4, 0, new double[] {0, 1, 0, 1});
		Vertex d = new Vertex(0, 4, 0, 0, new double[] {0, 0, 1, 1});
		edges.add(new Edge(a, b));
		edges.add(new Edge(b, c));
		edges.add(new Edge(c, d));
		edges.add(new Edge(d, a));
		Vertex a1 = new Vertex(0, 1, 1, 0, new double[] {0, 1, 1, 1});
		Vertex b1 = new Vertex(0, 3, 1, 0, new double[] {1, 0, 1, 1});
		Vertex c1 = new Vertex(0, 2, 3, 0, new double[] {1, 1, 1, 1});
		edges.add(new Edge(a1, b1));
		edges.add(new Edge(b1, c1));
		edges.add(new Edge(c1, a1));
		return edges;
	}
}
